package com.cimpm.networkDisk.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.hby.common.annotation.entity.VerifyMultiRepetitionField;

import java.util.Date;

@TableName("networkdisk_recycle_bin")
public class RecycleBin {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @VerifyMultiRepetitionField
    private Integer userId;

    @VerifyMultiRepetitionField
    private String path;

    @VerifyMultiRepetitionField
    private String name;

    private String nameInRecycle;

    private Integer originId;

    private Date deleteTime;

    private Integer isFolder;

    @TableLogic
    private Integer isDeleted;

    @Version
    private Integer version;

    public RecycleBin() {
    }

    public RecycleBin(NetworkDiskFile file){
        this.userId = file.getUserId();
        this.path = file.getPath();
        this.name = file.getName();
        this.originId = file.getId();
        this.isFolder = 0;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNameInRecycle() {
        return nameInRecycle;
    }

    public void setNameInRecycle(String nameInRecycle) {
        this.nameInRecycle = nameInRecycle;
    }

    public Integer getOriginId() {
        return originId;
    }

    public void setOriginId(Integer originId) {
        this.originId = originId;
    }

    public Integer getIsFolder() {
        return isFolder;
    }

    public void setIsFolder(Integer isFolder) {
        this.isFolder = isFolder;
    }

    public Date getDeleteTime() {
        return deleteTime;
    }

    public void setDeleteTime(Date deleteTime) {
        this.deleteTime = deleteTime;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "RecycleBin{" +
                "id=" + id +
                ", userId=" + userId +
                ", path='" + path + '\'' +
                ", name='" + name + '\'' +
                ", nameInRecycle='" + nameInRecycle + '\'' +
                ", originId=" + originId +
                ", deleteTime=" + deleteTime +
                ", isFolder=" + isFolder +
                ", isDeleted=" + isDeleted +
                ", version=" + version +
                '}';
    }
}
